package com.getword.init;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

public class Test
{
    private static final String host = "172.16.177.129";

    private static final int port = 5672;

    private static final String username = "guest";

    private static final String password = "guest";

    private static final String vhostname = "/";

    public static void main(String[] args)
        throws IOException, TimeoutException
    {
        ConnectionFactory connectionFactory = new ConnectionFactory();
        connectionFactory.setUsername(username);
        connectionFactory.setPassword(password);
        connectionFactory.setVirtualHost(vhostname);
        connectionFactory.setHost(host);
        connectionFactory.setPort(port);

        Connection connection = connectionFactory.newConnection();

        Channel channel = connection.createChannel();

        channel.close();
        connection.close();

    }
}
